//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	IServiceLocator.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

namespace Smart.Common.Locator
{
	/// <summary>
	/// Service locator and configuration
	/// </summary>
	public interface IServiceLocator
	{
		/// <summary>
		/// Register service
		/// </summary>
		void Register<TInterface, TClass>()
			where TClass : TInterface, new();

		/// <summary>
		/// Register service
		/// </summary>
		void Register<TInterface, TClass>(string key)
			where TClass : TInterface, new();

		/// <summary>
		/// Unregister service
		/// </summary>
		void Unregister<TInterface>(string key);

		/// <summary>
		/// Create instance of service
		/// </summary>
		TInterface GetInstance<TInterface>();

		/// <summary>
		/// Create instance of service
		/// </summary>
		TInterface GetInstance<TInterface>(string key);
	}
}